/*
 * @Author: szx
 * @Date: 2021-10-28 15:53:00
 * @LastEditTime: 2021-10-28 18:31:09
 * @Description:
 * @FilePath: \leetcode\231\231.cpp
 */
#include <iostream>
using namespace std;

class Solution {
   public:
    bool isPowerOfTwo(int n) {
        // while (n > 0) {
        //     if (n == 1) return true;
        //     if (n % 2 != 0) return false;
        //     n /= 2;
        // }
        // return false;
        return (n > 0) && (!(n & (n - 1)));
    }
};

int main() {}